<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="app">
        <div v-if="judge">
            1111
            <input type="text" key="1" />
        </div>

        <div v-else>
            2222
            <input type="text" key="2" />
        </div>
        <button @click="dianj">点击</button>
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                arr: [{
                    id: 1,
                    name: "张三",
                }, {
                    id: 2,
                    name: "李四",
                }, {
                    id: 3,
                    name: "王五",
                }, ],
                judge: true,
            },
            methods: {
                dianj() {
                    this.judge = !this.judge;
                },
            },
        });
    </script>
</body>

</html>